home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Software Contest 3
/
FM Towns Software Contest 3.iso
/
exp
/
video_t
/
no1
/
c_sorse
/
write2.c
< prev
Wrap
Text File
|
1994-01-07
|
7KB
|
252 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
int Dialog_page = -1 ;
int TIcon_page[2] = -1 ;
int _001Message_page = -1 ;
int _002Message_page = -1 ;
int TIcon_page2[4] = -1 ;
int _004Message_page = -1 ;
int _005Message_page = -1 ;
int _006Message_page = -1 ;
int _007Message_page = -1 ;
int Message_page = -1 ;
int DButton_pageon = -1 ;
int _001DButton_pageon = -1 ;
int _008Message_page = -1 ;
int _009Message_page = -1 ;
int _003Message_page = -1 ;
int Dialog_write = -1 ;
int Message_write = -1 ;
int TIcon_write[2] = -1 ;
int Message_write1 = -1 ;
int _001Message_write1 = -1 ;
int _002Message_write1 = -1 ;
int DButton_write1 = -1 ;
int DButton_write2 = -1 ;
int _003Message_write1 = -1 ;
int _004Message_write1 = -1 ;
extern int backid ;
extern int Dia_edit ;
extern int Dialog_menu ;
extern int Text ;
int radiopage = 0 ;
/* initDataPAGE:TIcon_page[0]:MJ_TICONL40の呼び出し関数 */
/* initDataPAGE:TIcon_page[1]:MJ_TICONL40の呼び出し関数 */
int page1(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
/* 現在選択状態にあるボタンを非選択状態にし、選択可にします */
MTL_resetFlagObj(radiopage,~(MS_UNSELECT | MS_TOGGLE)) ;
MMI_SendMessage(radiopage, MM_SHOW, 0) ;
/* 画面選択フラグを更新します */
radiopage = kobj ;
/* 呼び出し元トグルボタンを選択状態にし、選択不可にします */
MTL_setFlagObj(kobj, MS_UNSELECT | MS_TOGGLE) ;
MMI_SendMessage(kobj, MM_SHOW, 0) ;
return NOERR ;
}
/* initDataPAGE:TIcon_page2[0]:MJ_TICONL40の呼び出し関数 */
/* initDataPAGE:TIcon_page2[1]:MJ_TICONL40の呼び出し関数 */
/* initDataPAGE:TIcon_page2[2]:MJ_TICONL40の呼び出し関数 */
/* initDataPAGE:TIcon_page2[3]:MJ_TICONL40の呼び出し関数 */
int radiopage2 = 0 ;
int page2(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
/* 現在選択状態にあるボタンを非選択状態にし、選択可にします */
MTL_resetFlagObj(radiopage2,~(MS_UNSELECT | MS_TOGGLE)) ;
MMI_SendMessage(radiopage2, MM_SHOW, 0) ;
/* 画面選択フラグを更新します */
radiopage2 = kobj ;
/* 呼び出し元トグルボタンを選択状態にし、選択不可にします */
MTL_setFlagObj(kobj, MS_UNSELECT | MS_TOGGLE) ;
MMI_SendMessage(kobj, MM_SHOW, 0) ;
return NOERR ;
}
/* initDataPAGE:DButton_pageon:MJ_DBUTTONL40の呼び出し関数 */
int page_on(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int i,ii;
char moji[300];
char suu[10];
for (i = 0 ; i < 2 ; i++)
{
if (TIcon_page[i] == radiopage) break ;
}
for (ii = 0 ; ii < 4 ; ii++)
{
if (TIcon_page2[ii] == radiopage2) break ;
}
if(i!=2 && ii!=4)
{
moji[0]='\0';
strcat(moji,"/PAGE ");
_itoa(i,suu,10);
strcat(moji,suu);
strcat(moji," ");
_itoa(ii,suu,10);
strcat(moji,suu);
MMI_SendMessage(Text,MM_SETTEXT,3,moji,200,TRUE) ;
MMI_SendMessage(Text,MM_SETTEXT,3,"\n",5,TRUE) ;
MMI_SendMessage(Dialog_page,MM_ERASE,0) ;
MMI_SendMessage(Dialog_page,MM_DETACH,0) ;
MMI_SendMessage(Text, MM_ERASE, 0) ;
MMI_SendMessage(Text, MM_WAKE, 0) ;
MMI_SendMessage(Text, MM_SHOW, 0) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dia_edit, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
}
return NOERR ;
}
/* initDataPAGE:_001DButton_pageon:MJ_DBUTTONL40の呼び出し関数 */
int page_off(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Dialog_page,MM_ERASE,0) ;
MMI_SendMessage(Dialog_page,MM_DETACH,0) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dia_edit, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
return NOERR ;
}
/* initDataWRITE:TIcon_write[0]:MJ_TICONL40の呼び出し関数 */
/* initDataWRITE:TIcon_write[1]:MJ_TICONL40の呼び出し関数 */
int radiowrite=0;
int write_func(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
/* 現在選択状態にあるボタンを非選択状態にし、選択可にします */
MTL_resetFlagObj(radiowrite,~(MS_UNSELECT | MS_TOGGLE)) ;
MMI_SendMessage(radiowrite, MM_SHOW, 0) ;
/* 画面選択フラグを更新します */
radiowrite = kobj ;
/* 呼び出し元トグルボタンを選択状態にし、選択不可にします */
MTL_setFlagObj(kobj, MS_UNSELECT | MS_TOGGLE) ;
MMI_SendMessage(kobj, MM_SHOW, 0) ;
return NOERR ;
}
/* initDataWRITE:DButton_write1:MJ_DBUTTONL40の呼び出し関数 */
int write_on(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int i;
char moji[300];
char suu[10];
for (i = 0 ; i < 2 ; i++)
{
if (TIcon_write[i] == radiowrite) break ;
}
if(i<2)
{
moji[0]='\0';
if(i==0) strcat(moji,"/WRITE 0");
else strcat(moji,"/WRITE 1");
MMI_SendMessage(Text,MM_SETTEXT,3,moji,200,TRUE) ;
MMI_SendMessage(Text,MM_SETTEXT,3,"\n",5,TRUE) ;
MMI_SendMessage(Dialog_write,MM_ERASE,0) ;
MMI_SendMessage(Dialog_write,MM_DETACH,0) ;
MMI_SendMessage(Text, MM_ERASE, 0) ;
MMI_SendMessage(Text, MM_WAKE, 0) ;
MMI_SendMessage(Text, MM_SHOW, 0) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dia_edit, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
}
return NOERR ;
}
/* initDataWRITE:DButton_write2:MJ_DBUTTONL40の呼び出し関数 */
int write_off(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Dialog_write,MM_ERASE,0) ;
MMI_SendMessage(Dialog_write,MM_DETACH,0) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dia_edit, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
return NOERR ;
}
int l_page()
{
/* 背景を選択不可とします。*/
MTL_setAtrObj(backid, MS_DSPONLYL40) ;
MTL_setAtrObj(Dialog_menu, MS_DSPONLYL40) ;
MTL_setAtrObj(Dia_edit, MS_DSPONLYL40) ;
MMI_SendMessage(Dialog_page,MM_ATTACH,1,MMI_GetBaseObj()) ;
MMI_SendMessage(Dialog_page, MM_SHOW, 0) ;
return NOERR ;
}
int l_write()
{
/* 背景を選択不可とします。*/
MTL_setAtrObj(backid, MS_DSPONLYL40) ;
MTL_setAtrObj(Dialog_menu, MS_DSPONLYL40) ;
MTL_setAtrObj(Dia_edit, MS_DSPONLYL40) ;
MMI_SendMessage(Dialog_write,MM_ATTACH,1,MMI_GetBaseObj()) ;
MMI_SendMessage(Dialog_write, MM_SHOW, 0) ;
return NOERR ;
}